<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Generate</title>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link  th:href="@{/css/style.css}" rel='stylesheet' type='text/css' />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript" th:src="@{/js/jquery-3.5.1.js}"></script>
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</head>
<script type="text/javascript" >
	function iclear(url) {
		var from = $("form");
		from.attr("action",url);
		from.submit();
	}

</script>
<body>
<div class="main">
    <div class="login-form">
        <h1>Mybatis-plus Generate </h1>
        <!--/*@thymesVar id="dataEntity" type=""*/-->
        <form th:action="@{/api/generate}" th:object="${dataEntity}" method="post">
            <input type="text" class="text" th:field="*{dataUrl}" value="DataUrl"  onfocus="this.value = '';"  onblur="if (this.value == '') {this.value = 'DataUrl';}" >
            <input type="text" class="text" th:field="*{user}" value="User"  onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'User';}">
            <input type="text" class="text" th:field="*{password}"   value="Password"  onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">
            <input type="text" class="text" th:field="*{path}" value="Path" onfocus="this.value = '';"  onblur="if (this.value == '') {this.value = 'Path';}">
            <input type="text" class="text" th:field="*{tableName}" value="TableName" onfocus="this.value = '';"  onblur="if (this.value == '') {this.value = 'TableName';}">
            <input type="text" class="text" th:field="*{author}" value="Author" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Author';}">
            <div class="submit">
                <input type="submit"  value="GENERATE" >
            </div>
            <!--             -->
            <div >
                <div class="below">
                    <a  style="text-decoration:none;" target="_blank" th:if="${download!=null}" th:href="${download}">
                        <img  th:src="@{/images/download.jpg}">
                    </a>
                    <a  style="text-decoration:none;" target="_blank" th:if="${download==null}" >
                        <img  th:src="@{/images/download.jpg}">
                    </a>
                    <a  style="text-decoration:none;" href="javascript:void(0)"  th:onclick="iclear([[@{/api/clear}]])">
                        <img style="float: right"  th:src="@{/images/clear.jpg}" >
                    </a>
                </div>
            </div>
            <div  th:if="${error != null}" style="color:#F00" th:text="${error}"></div>
            <!--                    <p><a href="#">Forgot Password ?</a></p>-->
        </form>
    </div>
    <div class="copy-right">
        <p>Copyright &copy; 2021.Company name All rights reserved.</p>
    </div>
</div>
<div style="display:none"></div>

</body>
</html>
